package com.hmall.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.order.pojo.Order;
import com.hmall.order.pojo.OrderDetail;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OrderMapper extends BaseMapper<Order> {
    @Select("select status from tb_order where id=#{orderId}")
    int findStatusById(Long orderId);

    @Select("select * from tb_order_detail where order_id=#{orderId} ")
    OrderDetail getOrderDetail(Long orderId);

    @Update("update tb_order set status=5 where id=#{orderId}")
    int cancelOrder(Long orderId);
    @Update("update tb_order set status=2 where id=#{orderId}")
    int payisOk(Long orderId);
}
